﻿using CampusTrade.Dao;
using CampusTrade.Pojo;
using Furion.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace CampusTrade.Service
{
    public class ConsultService : ITransient
    {
        private readonly ConsultDao consultDao;
        public ConsultService(ConsultDao consultDao)
        {
            this.consultDao = consultDao;
        }

        //添加提问
        public long addQuestion(Question question)
        {
            return consultDao.addQuestion(question);
        }

        //删除提问
        public int deleteQuestion(long id)
        {
            return consultDao.deleteQuestion(id);
        }

        //添加回复
        public long addAnswer(Answer answer)
        {
            return consultDao.addAnswer(answer);
        }

        //删除回复
        public int deletAnswer(long id)
        {
            return consultDao.deleteAnswer(id);
        }

        //获取提问
        public List<Question> getQuestion(long goodId)
        {
            return consultDao.getQuestion(goodId);
        }

        //获取回答
        public List<Answer> getAnswer(long questionId)
        {
            return consultDao.getAnswer(questionId);
        }
    }
}
